from typing import *


class Solution:
    def kthCharacter(self, k: int, operations: List[int]) -> str:
        p = 0
        for i in range(len(operations)):
            if 1 << i < k:
                p = i
        k -= 1
        t = 0
        while k > 0:
            t += operations[p]
            k -= 1 << p
            while p > -1 and 1 << p > k:
                p -= 1
        return chr((t % 26 + ord("a")))


s = Solution()
print(s.kthCharacter(k=5, operations=[0, 0, 0]))
print(s.kthCharacter(k=10, operations=[0, 1, 0, 1]))
print(s.kthCharacter(3, [1, 0]))
